home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctjmr86.arc
/
DOSCOM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-12-16
|
1KB
|
33 lines
program doscom; { EXECUTE DOS COMMANDS }
{$I spmmlib.pas} { INCLUDE SUB-PROCESSES & MEMORY MANAGEMENT }
var
parameter_string,program_name:asciiz;
memory_segment,pp_to_release :integer;
begin
pp_to_release:=$6A5; { PLENTY FOR DOS 3.1 }
if dos48H(pp_to_release,memory_segment)=0 then
begin { SEE IF ENOUGH MEMORY FREE }
if dos_error_check(dos49H(memory_segment)) then
exit;
end
else { IF NOT, THEN REDUCE THE SIZE OF THE CURRENT ALLOCATION }
if dos_error_check(dos4AH(pp_to_release)) then
exit;
if get_comspec(program_name) then
exit; { TERMINATE IF CANT GET COMSPEC NAME }
while true do
begin
writeln;write('Enter DOS Command: ');
readln(parameter_string);
{ BUILD THE PARAMETER STRING FOR COMMMAND.COM }
if (parameter_string='bye') or (parameter_string='BYE') then
exit;
parameter_string:='/c '+parameter_string;
parameter_string[length(parameter_string)+1]:=#13;
if dos_error_check(dos4BH(program_name,parameter_string)) then
writeln('Command Cancelled.')
end;
end.